<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
    </head>
    <body>
        <script type="text/javascript">
            var reg = /^-?[0-9]+(\.[0-9]+)?$/
            console.log(reg);
            //匹配1999-10-11
            var reg1 = /^[1-9]\d{0,3}-((1[0-2])|(0[1-9]))-((0[1-9])|(3[0-1])|([12]\d))$/
            console.log(reg1);

            //匹配QQ号(5-12位,第一位非零)
            var reg2 = /^[1-9]\d{4,11}$/
            console.log(reg2);

            //11位电话号码
            var phone = /^\d{11}$/
            console.log(phone);

            //8-10位用户密码
            var password = /^\w{8,10}$/
            console.log(password.test("wt123456"));

            //4位验证码
            var yzm = /^[A-z\d]{4}$/
            console.log(yzm.test("qwe2"));

            //邮箱 abc17835195@qqx.com.cn
            var email = /^\w+@\w+(\.[A-z]+)+$/
            console.log(email.test("1793077132@qq.com"));
        </script>
    </body>
</html>